package study.mq.kafka.consumer.support.deserializer;

import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.common.serialization.Deserializer;

import java.util.Map;

/**
 * 反序列化器
 */
@Slf4j
public class CustomDeserializer implements Deserializer<String> {

    private String encoding = "UTF8";

    @Override
    public void configure(Map<String, ?> configs, boolean isKey) {
        log.info(">>>>>>>>>> 序列化器 configure, is_key= {}", isKey);
    }

    @Override
    public String deserialize(String topic, byte[] data) {
        log.info(">>>>>>>>>> deserialize");
        return new String(data);
    }
}
